package baiying_remote

type CustomerItem struct {
	Phone string `json:"phone"`
	Name  string `json:"name"`
}

type CustomerImportRequest struct {
	CallJobId          int64           `json:"callJobId"`
	CompanyId          int64           `json:"companyId"`
	CustomerInfoVOList []*CustomerItem `json:"-"`
}

type CustomerImportResponse struct {
	Code int `json:"code"`
	Data struct {
		Total           int32  `json:"total"`
		SuccessNum      int32  `json:"successNum"`
		PlaceFailNum    int32  `json:"placeFailNum"`
		RepeatNum       int32  `json:"repeatNum"`
		PlaceFailDetail string `json:"placeFailDetail"`
	}
	ResultMsg string `json:"resultMsg"`
}

type CreateTaskRequest struct {
	CallJobName         string `json:"callJobName"`
	CallJobType         int32  `json:"callJobType"`
	CompanyId           int64  `json:"companyId"`
	ConcurrencyQuota    int32  `json:"concurrencyQuota"`
	RepeatCall          bool   `json:"repeatCall"`
	RepeatCallRule      string `json:"repeatCallRule"`
	Interval            int    `json:"interval"`
	PhoneStatus         int    `json:"phoneStatus"`
	Times               int    `json:"times"`
	RobotDefId          int64  `json:"robotDefId"`
	StartDate           string `json:"startDate"`
	UserPhoneIds        string `json:"userPhoneIds"`
	WorkingTimeRuleList string `json:"workingTimeRuleList"`
}

type UpdateTaskRequest struct {
	BreakStartClose     bool   `json:"breakStartClose"`
	CallJobId           int64  `json:"callJobId"`
	CallJobName         string `json:"callJobName"`
	CallJobType         int32  `json:"callJobType"`
	CompanyId           int64  `json:"companyId"`
	ConcurrencyNum      int    `json:"concurrencyNum"`
	ConcurrencyQuota    int32  `json:"concurrencyQuota"`
	RepeatCall          bool   `json:"repeatCall"`
	RepeatCallRule      string `json:"repeatCallRule"`
	Interval            int    `json:"interval"`
	PhoneStatus         int    `json:"phoneStatus"`
	Times               int    `json:"times"`
	StartDate           string `json:"startDate"`
	RobotDefId          int64  `json:"robotDefId"`
	UserPhoneIds        string `json:"userPhoneIds"`
	WorkingTimeRuleList string `json:"workingTimeRuleList"`
}

type RepeatCallRuleItem struct {
	Interval    int   `json:"interval"`
	PhoneStatus int   `json:"phoneStatus"`
	Times       int32 `json:"times"`
}

type WorkingTimeRule struct {
	TimeRangeList []TimeRange `json:"timeRanges"`
	Weeks         []int       `json:"weeks"`
}

type TimeRange struct {
	StartTime string `json:"startTime"`
	EndTime   string `json:"endTime"`
}

type CreateTaskResponse struct {
	Code int `json:"code"`
	Data struct {
		CallJobId int64 `json:"callJobId"`
	} `json:"data"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}

type UpdateTaskResponse struct {
	Code      int    `json:"code"`
	ResultMsg string `json:"resultMsg"`
}

// DeleteTaskRequest 删除任务请求
type DeleteTaskRequest struct {
	CallJobId int64 `json:"callJobId"`
	CompanyId int64 `json:"companyId"`
}

// DeleteTaskResponse 删除任务返回
type DeleteTaskResponse struct {
	Code      int    `json:"code"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}

// ExecuteTaskRequest 执行任务的请求
type ExecuteTaskRequest struct {
	CallJobId int64 `json:"callJobId"`
	CompanyId int64 `json:"companyId"`
	Command   int32 `json:"command"`
}

// ExecuteTaskResponse 执行任务的返回
type ExecuteTaskResponse struct {
	Code      int    `json:"code"`
	ResultMsg string `json:"resultMsg"`
}

type PhoneListRequest struct {
	CompanyId int64 `json:"companyId"`
}

type PhoneListResponse struct {
	Code int `json:"code"`
	Data []struct {
		RateType            int32   `json:"rateType"`
		PhoneType           int32   `json:"phoneType"`
		NonlocalSellingRate float64 `json:"nonlocalSellingRate"`
		Phone               string  `json:"phone"`
		SceneType           int32   `json:"sceneType"`
		UserPhoneId         int64   `json:"userPhoneId"`
		LocalSellingRate    float64 `json:"localSellingRate"`
		PhoneName           string  `json:"phoneName"`
		LineAmount          float64 `json:"lineAmount"`
		BillPeriod          int32   `json:"billPeriod"`
	} `json:"data"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}

type SeatInfoListRequest struct {
	CompanyId int64 `json:"companyId"`
}

type SeatInfoListResponse struct {
	Code int `json:"code"`
	Data struct {
		CompanyUsingCallSeat int32 `json:"companyUsingCallSeat"`
		CompanyAllCallSeat   int32 `json:"companyAllCallSeat"`
		CallSeatList         []struct {
			ValidityBegin    string `json:"validityBegin"`
			ConcurrencyQuota int32  `json:"concurrencyQuota"`
			ServicePeriodId  string `json:"servicePeriodId"`
			ValidityEnd      string `json:"validityEnd"`
			RemainingDays    int32  `json:"remainingDays"`
		} `json:"callSeatList"`
	} `json:"data"`
	ResultMsg string `json:"resultMsg"`
}

type GetBalanceRequest struct {
	CompanyId int64 `json:"companyId"`
}

type GetBalanceResponse struct {
	Code int `json:"code"`
	Data struct {
		Amount float64 `json:"amount"` //5702.4,
		Price   string `json:"price"` //    "price": "1100.00分/分钟",
		UserAccountId   int64 `json:"userAccountId"`
		Num   int64 `json:"num"`
	} `json:"data"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}

type RobotListRequest struct {
	CompanyId   int64 `json:"companyId"`
	RobotStatus int32 `json:"robotStatus"`
}

type RobotListResponse struct {
	Code int `json:"code"`
	Data []struct {
		RobotDefId      int64  `json:"robotDefId"`
		RobotName       string `json:"robotName"`
		RobotStatus     int32  `json:"robotStatus"`
		IndustryOneName string `json:"industryOneName"`
		DeployTime      string `json:"deployTime,omitempty"`
		IndustryTwoName string `json:"industryTwoName"`
	} `json:"data"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}

type GetTaskDetailRequest struct {
	CompanyId int64 `json:"companyId"`
	CallJobId int64 `json:"callJobId"`
}

type GetTaskDetailResponse struct {
	Code int `json:"code"`
	Data struct {
		JobName              string `json:"jobName"`
		CallJobStatus        int32  `json:"callJobStatus"`
		CallJobStatusDesc    string `json:"callJobStatusDesc"`
		DoneCount            int32  `json:"doneCount"`
		FromUnavailableCount int32  `json:"fromUnavailableCount"`
		CallPhones           []struct {
			PhoneType   int    `json:"phoneType"`
			Phone       string `json:"phone"`
			SceneType   int    `json:"sceneType"`
			UserPhoneId int    `json:"userPhoneId"`
			PhoneName   string `json:"phoneName"`
		} `json:"callPhones"`
		CallJobId        int64 `json:"callJobId"`
		UnavailableCount int32 `json:"unavailableCount"`
		ResultDefs       []struct {
			Values []string `json:"values"`
			Name   string   `json:"name"`
		} `json:"resultDefs"`
		RejectedCount int32  `json:"rejectedCount"`
		Remark        string `json:"remark"`
		DurationStat  []struct {
			Values int    `json:"value"`
			Name   string `json:"name"`
		} `json:"durationStat"`
		TotalCount          int32   `json:"totalCount"`
		SeatNum             int32   `json:"seatNum"`
		RepeatCall          bool    `json:"repeatCall"`
		RepeatCallRule      string  `json:"repeatCallRule"`
		WorkingStartTime    string  `json:"workingStartTime"`
		WorkingEndTime      string  `json:"workingEndTime"`
		CalledCount         int32   `json:"calledCount"`
		JobType             int32   `json:"jobType"`
		RobotDefName        string  `json:"robotDefName"`
		StartDate           int64   `json:"startDate"`
		RobotDefId          int64   `json:"robotDefId"`
		UserPhoneIds        []int64 `json:"userPhoneIds"`
		WorkingTimeRuleList []struct {
			TimeRanges []struct {
				StartTime string `json:"startTime"`
				EndTime   string `json:"endTime"`
			} `json:"timeRanges"`
			Weeks []int `json:"weeks"`
		} `json:"workingTimeRuleList"`
	} `json:"data"`
	ResultMsg string `json:"resultMsg"`
}

type GetUnStartCallListRequest struct {
	CallJobId int64 `json:"callJobId"`
	CompanyId int64 `json:"companyId"`
	PageNum   int32 `json:"pageNum"`
	PageSize  int32 `json:"pageSize"`
}

type GetUnStartCallListResponse struct {
	Code int `json:"code"`
	Data struct {
		Total   int32             `json:"total"`
		Pages   int               `json:"pages"`
		List    []UnStartCallItem `json:"list"`
		PageNum int               `json:"pageNum"`
	} `json:"data"`
	ResultMsg string `json:"resultMsg"`
}

type UnStartCallItem struct {
	CallInstanceId    int64  `json:"callInstanceId"`
	CustomerTelephone string `json:"customerTelephone"`
	CustomerName      string `json:"customerName"`
}

type GetTaskListRequest struct {
	CallJobStatus int32  `json:"callJobStatus"`
	CompanyId     int64  `json:"companyId"`
	CreateDate    string `json:"createDate"`
	EndDate       string `json:"endDate"`
	JobName       string `json:"jobName"`
	PageNum       int32  `json:"pageNum"`
	PageSize      int32  `json:"pageSize"`
	//CallJobStatus struct {
	//	Valid bool
	//	value int32
	//} `json:"callJobStatus"`
}

type GetTaskListResponse struct {
	Code int `json:"code"`
	Data struct {
		Total int32 `json:"total"`
		Pages int32 `json:"pages"`
		List  []struct {
			JobName              string `json:"jobName"`
			CallJobStatus        int32  `json:"callJobStatus"`
			CallJobStatusDesc    string `json:"callJobStatusDesc"`
			FromUnavailableCount int32  `json:"fromUnavailableCount"`
			DoneCount            int32  `json:"doneCount"`
			UnavailableCount     int32  `json:"unavailableCount"`
			CallJobId            int64  `json:"callJobId"`
			RejectedCount        int32  `json:"rejectedCount"`
			Remark               string `json:"remark"`
			TotalCount           int32  `json:"totalCount"`
			WorkingStartTime     string `json:"workingStartTime"`
			WorkingEndTime       string `json:"workingEndTime"`
			CalledCount          int32  `json:"calledCount"`
			JobType              int32  `json:"jobType"`
			StartDate            int64  `json:"startDate"`
		} `json:"list"`
		PageNum int `json:"pageNum"`
	} `json:"data"`
	ResultMsg string `json:"resultMsg"`
}

type GetBatchJobStatusListRequest struct {
	CompanyId     int64  `json:"companyId"`
	CallJobIdList string `json:"callJobIdList"`
}

type GetBatchJobStatusListResponse struct {
	Code int `json:"code"`
	Data []struct {
		CallJobId int `json:"callJobId"`
		Status    int `json:"status"`
	} `json:"data"`
	RequestId string `json:"requestId"`
	ResultMsg string `json:"resultMsg"`
}
